﻿@addTagHelper *, WebVella.Erp.Plugins.Core
@addTagHelper *, WebVella.Erp.Web
@addTagHelper *, WebVella.TagHelpers
@using WebVella.Erp.Web.Utils;
@using WebVella.Erp.Api.Models;
@using WebVella.Erp.Web.Models;
@using WebVella.Erp.Plugins.Project.Components;
@using WebVella.TagHelpers.Models;
@{
	var options = (PcProjectWidgetTasksChart.PcProjectWidgetTasksChartOptions)ViewBag.Options;
	var datasets = (List<WvChartDataset>)ViewBag.Datasets;
	var overdueTasks = (int)ViewBag.OverdueTasks;
	var dueToday = (int)ViewBag.DueTodayTasks;
	var notDueTasks = (int)ViewBag.NotDueTasks;
}
<wv-row flex-vertical-alignment="Center" class="w-100 h-100" no-gutters="true">
	<wv-column class="flex-grow-0">
		<wv-chart type="Doughnut" datasets="@datasets" width="100px" height="100px"></wv-chart>		
	</wv-column>
	<wv-column class="flex-grow-1 pl-4">
		<wv-row class="mb-2">
			<wv-column>
				<div>Overdue</div>
				<div class="@(overdueTasks > 0 ? "go-red" : "go-gray")">@overdueTasks</div>		
			</wv-column>
			<wv-column>
				<div>Due today</div>
				<div class="@(dueToday > 0 ? "go-orange" : "go-gray")">@dueToday</div>		
			</wv-column>
		</wv-row>
		<wv-row class="mb-2">
			<wv-column>
				<div>Upcoming due</div>
				<div class="@(notDueTasks > 0 ? "go-green" : "go-gray")">@notDueTasks</div>	
			</wv-column>

		</wv-row>		
	</wv-column>
</wv-row>